package com.lcb.jmm.thread;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/****
 * @Author:刘长柏
 * @Date: 2021-01-07 10:37
 * @Description:线程池例子
 *****/
public class ExecutorSample {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newFixedThreadPool(8);
        for (int i = 0; i <20 ; i++) {
            //executor.execute(new RunTask());
            executor.submit(new CallTask());
        }

//        executor.shutdownNow();
//        executor.execute(new RunTask());
    }
}
